﻿using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using wt.wine.Application.Common.Models;
using wt.wine.Application.UserTables;
using wt.wine.Application.UserTables.Queries;

namespace WebAPI.Controllers
{
    [ApiController]
    [Route("[controller]")]
    public class LoginController : ApiControllerBase
    {
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<Json<LoginDTO>> Login([FromBody] LoginQueries query)
        {
            return await Mediator.Send(query);
        }
    }
}
